<?php
require dirname(__FILE__) . '/../auto_load.php';
class UserModelTest extends PHPUnit_Framework_TestCase
{
	private $user_model;
	
	public function setUp()
	{
		$this->user_model = new UserModel();
	}
	
	public function testAddUserToDb()
	{
		$data = array(
			'id' => '13107471080789372119',
			'avatar_uri' => 'http://example.com/',
			'name' => 'example'
		);
		$result = $this->user_model->addUserToDb($data);
		var_dump($result);
	}
	
	public function testGetUserFromDbById()
	{
		$id = '13107471080789372119';
		$result = $this->user_model->getUserFromDbById($id);
		var_dump($result);
	}
	
	public function testGetUserFromGoogleFriendConnect()
	{
		$auth = 'ALhR-_tnBEPbh6QQF-MGml_s2cqfZBmYqmKmFMW6_4oiRPLzaR_k6w5l2WXgOQXsV9mizwLR-PsyDE32er__7mQERbC8l68zPA~13107471080789372119~z5ZYAXbWF1d3';
		$result = $this->user_model->getUserFromGoogleFriendConnect($auth);
		var_dump($result);
	}
	public function testSetUserToDb()
	{
		$data = array(
			'id' => '13107471080789372119',
			'avatar_uri' => 'http://example.com/?2',
			'name' => 'example2'
		);
		$result = $this->user_model->setUserToDb($data);
		var_dump($result);
	}
	
	public function testUpdateUserToDb()
	{
		$data = array(
			'id' => '13107471080789372119',
			'avatar_uri' => 'http://example.com/?3',
			'name' => 'example3'
		);
		$result = $this->user_model->updateUserToDb($data);
		var_dump($result);
	}
}
?>